function [d,a,n,s] = rdxsec(file,numm,numg)
% function [d,a,n,s] = rdxsec(file,numm,numg)
%    file       = filename
%    numm       = number of materials
%    numg       = number of groups
%       d       = diffusion coefficients
%       a       = absorptio (better, removal) cross-section
%       n       = nu*sigmaF
%       s       = scattering matrix (upper triangle)
xsec = load(file);
if length(xsec(:,1))~=numg*numm
    disp('warning: numg ~= numm')
end
d = zeros(numm,numg);
a = zeros(numm,numg);
n = zeros(numm,numg);
s = zeros(numm,numg,numg);
for m = 1:numm
    data = xsec( ((m-1)*numg+1):(m*(numg)), :);
    d(m,:) = data(:,1)';
    a(m,:) = data(:,2)';
    n(m,:) = data(:,3)';
    data = data(:,4:end); % now g by g
    for j = 1:numg
        %for jj = 1:numg
        s(m,j,1:numg) = data(j,1:numg);
        %end
    end
end     
